import com.google.appengine.api.datastore.*
import static com.google.appengine.api.datastore.FetchOptions.Builder.*
 
// query the scripts stored in the datastore
def query = new Query("Provincia")
 
 
PreparedQuery preparedQuery = datastore.prepare(query)
 
// return only the first 20 results
def entities = preparedQuery.asList( withLimit(20) )

/*html.ul(class: 'imagenes') {
    li { b "Concellos: " }
    entities.each {concello ->
        if (concello) {
            li {
                span class: 'concello', {
                	a href:"verConcello.groovy?id=${concello.key?.id}", "${concello.nome}"
                }
            }
        }
    }
}*/

html.select(id:'provincia', name:'provincia') {
	entities.each {provincia->
		if (provincia) {
			option value:"${provincia.key?.id}","${provincia.nome}"
		}
	}

}

